<?php defined( '_SYS' ) or die( 'No direct script access allowed' );?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title><?php echo $this->title;$weburl = WEBURL.'/'.SELF; ?></title>
<?php echo $this->headData; ?>
</head>
<body>

	<div id="toolbar-box">
		<div class="t">
			<div class="t">
				<div class="t"></div>
			</div>
		</div>
		<div class="m">
			<div class="toolbar" id="toolbar">
				<table class="toolbar">
					<tr>
						<td class="button" id="toolbar-save">
							<a href="#" class="toolbar" id="sendmail">
								<span class="icon-32-save" title="Save">
								</span>
							<?php echo C_text::_('Save_Mail');?>
							</a>
						</td>
						<td class="button" id="toolbar-save">
							<a href="#" onclick="javascript: submitbutton('save')" class="toolbar">
								<span class="icon-32-save" title="Save">
								</span>
							<?php echo C_text::_('Save');?>
							</a>
						</td>
						
						<td class="button" id="toolbar-apply">
							<a href="#" onclick="javascript: submitbutton('apply')" class="toolbar">
								<span class="icon-32-apply" title="Apply">
								</span>
							<?php echo C_text::_('Apply');?>
							</a>
						</td>

						<td class="button" id="toolbar-cancel">
							<a href="#" onclick="javascript: submitbutton('cancel')" class="toolbar">
								<span class="icon-32-cancel" title="Cancel">
								</span>
							<?php echo C_text::_('Cancel');?>
							</a>
						</td>
					</tr>
				</table>
			</div>
			<div class="header icon-48-massmail"><?php echo C_text::_('ToolBox');?>: <small><small><?php echo $this->subTitle;?></small></small></div>	
			<div class="clr"></div>		
		</div>
		<div class="b">
			<div class="b">
				<div class="b"></div>
			</div>
		</div>
	</div>
	<div class="clr"></div>
<?php 
	if($this->message) echo $this->message;
?>
<div id="element-box">
		<div class="t">
			<div class="t">
				<div class="t"></div>
			</div>
		</div>	
<div class="m" id="width-100">
	
	
	<form action="<?php echo WEBSELF; ?>/feedback" method="post" name="adminForm" autocomplete="off"  onsubmit="return checkPaging()">

<div class="width-100">
	<fieldset class="adminform">
		<legend><?php echo C_text::_('Feedback_Detail');?></legend>
		<table class="admintable" cellspacing="1">
			<?php
			$data = unserialize($this->item['data']);
			for ($i=0, $n=count( $data ); $i < $n; $i++)
			{
				$row 	=& $data[$i];
			?>
				<tr class="row0">
					<td width="150" class="key">
						<label for="no_order">
							<?php echo $row->key; ?>
						</label>
					</td>
					<td>
						<?php 
						if(strlen($row->value)>100)
						{
						?>
						<textarea class="text_area" cols="60" rows="20" style="width:600px; height:120px" name="feedback[<?php echo $row->key; ?>]" ><?php echo $row->value; ?></textarea>						
						<?php
						}
						else 
						{
						?>
						<input class="text_area" type="text" size="50" name="feedback[<?php echo $row->key; ?>]" value="<?php echo $row->value; ?>"></input>
						<?php						
						}
						?>
					</td>
				</tr>
			<?php

			}
			?>
				<tr class="row0">
					<td width="150" class="key">
						<label for="no_order">
							<?php echo C_text::_( 'Item1' ); ?>
						</label>
					</td>
					<td>
						<input class="text_area" type="text" size="50" name="fdtitle" value="<?php echo $this->item['fdtitle']; ?>"></input>						
					</td>
				</tr>
				<tr class="row0">
					<td width="150" class="key">
						<label>
							<?php echo C_text::_( 'Item2' ); ?>
						</label>
					</td>
					<td>
						<input class="text_area" type="text" size="50" name="fromurl" value="<?php echo $this->item['fromurl']; ?>"></input>
					</td>
				</tr>
				<tr class="row0">
					<td class="key">
						<label>
							<?php echo C_text::_( 'Item3' ); ?>
						</label>
					</td>
					<td>
						<input class="text_area" type="text" size="50" name="ip" value="<?php echo $this->item['ip']; ?>"></input>
					</td>
				</tr>
				<tr class="row0">
					<td class="key">
						<label>
							<?php echo C_text::_( 'Item4' ); ?>
						</label>
					</td>
					<td>
						<input class="text_area" type="text" size="50" name="addtime" value="<?php echo $this->item['addtime']; ?>"></input>
					</td>
				</tr>
				<tr class="row0">
					<td class="key">
						<label>
							<?php echo C_text::_( 'Item7' ); ?>
						</label>
					</td>
					<td>
						<?php echo $this->mailtpls;?>
					</td>
				</tr>
				<tr class="row0">
					<td class="key">
						<label>
							<?php echo C_text::_( 'Item8' ); ?>
						</label>
					</td>
					<td>
						<input class="text_area" type="text" size="50" name="email" id="email" value=""></input>
					</td>
				</tr>
				<tr class="row0">
					<td class="key">
						<label>
							<?php echo C_text::_( 'Item9' ); ?>
						</label>
					</td>
					<td>
						<input class="text_area" type="text" size="50" name="subject" id="subject" value=""></input>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label>
							<?php echo C_text::_( 'Item5' ); ?>
						</label>
					</td>
					<td>
						<textarea class="text_area" cols="60" rows="20" style="width:600px; height:120px" name="useinfo" ondblclick="replaceContent('useinfo')"><?php echo $this->item['useinfo']; ?></textarea>
					</td>
				</tr>
			</table>
	</fieldset>

	<input type="hidden" name="task" value="" />
	<input type="hidden" name="apply" value="<?php echo $this->apply; ?>" />
	<input type="hidden" name="number" value="<?php echo $this->item['number']; ?>" />
	<input type="hidden" name="module" value="<?php echo $this->item['module']; ?>" />
	<input type="hidden" name="id" value="<?php if(isset($this->item['id'])) echo $this->item['id']; ?>" />
	<?php echo C_HTML::_( 'form.token' ); ?>
	</div>	
</form>
</div>
		<div class="b">
			<div class="b">
				<div class="b"></div>
			</div>
		</div>
</div>
<center>
	Powered by <b><a href='http://www.metinfo.cn' target='_blank'>MetInfo</a></b> ©2008- <?php echo date('Y',time());?>&nbsp;<a href='http://www.metinfo.cn' target='_blank'>www.MetInfo.cn</a>
</center>
<?php echo $this->js; ?>
<script type="text/javascript">
	/* ajax alert */
	$('sendmail').addEvent('click', function(event) {
		//prevent the page from changing
		event.stop();
		if($('mailtpl').get('value') == 0 || $('email').get('value') == '' || $('subject').get('value') == '')
		{
			alert('<?php echo C_text::_( 'Item11' ); ?>');
		}else
		{
			submitbutton('save');
		}
		
	});
</script>
</body>
</html>